<?php

require_once "BaseService.php";

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DocentesService
 *
 * @author Virtualidad
 */
class DocentesService extends BaseService {

    /**
     *
     * @param string $NIT
     * @return Docentes
     */
    public function GetById($NIT) {
        $response = parent::invokeService("GetById", $NIT);
        
        if ($response != ""){
            Loader::using("models::entities::Docentes");
            $result = parent::processSingleObjectResponse($response, parent::getMimeType(), "Docentes", Docentes::MAPPING());
        }  else {
            $result = null;
        }

        return $result;
    }
    
    /**
     *
     * @param string $username
     * @return Docentes
     */
    public function GetByUserName($username) {        

        $response = parent::invokeService("GetByUserName", json_encode($username), false, "GET");
        
        
        if ($response != ""){
            Loader::using("models::entities::Docentes");
            $result = parent::processSingleObjectResponse($response, parent::getMimeType(), "Docentes", Docentes::MAPPING());
        }  else {
            $result = null;
        }

        return $result;
    }

    public function Update(Docentes $Docente) {
        Loader::using("models::entities::Docentes");
        $serializer = parent::getSerializer("Docentes");
        $data = $serializer->serialize($Docente);
        $response = parent::invokeService("Update", $data);

        return $response;
    }

    public function getServiceClass() {
        return "Docentes";
    }

}

?>
